<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="ext.acae2.dms.web.input.CheckProcessor" %>
<%@ page import="java.util.*" %>
<%@ page import="ext.acae2.dms.resource.DataExchangeResource" %>
<%@ page import="wt.util.WTMessage" %>
<%
List<String> result = new CheckProcessor().check(request);

String RESOURCE = DataExchangeResource.class.getName();

String success_msg = WTMessage.getLocalizedMessage(RESOURCE, DataExchangeResource.DATA_PACK_CHECK_SUCCESS);
String failure_msg = WTMessage.getLocalizedMessage(RESOURCE, DataExchangeResource.DATA_PACK_CHECK_FAILURE);

StringBuffer msg = new StringBuffer();

if (result.size() == 0) {
    out.println("<script>parent.callback('" + success_msg + "')</script>");
    out.println("<script>parent.changeButton()</script>");
} else {
    msg.append(failure_msg);
    msg.append("\\n");
    for (int i=0; i<result.size(); i++) {
        msg.append(result.get(i));
	if (i != result.size()-1) {
            msg.append("\\n");
	}
    }
    out.println("<script>parent.callback('" + msg.toString() + "')</script>");  
}
%>